//
//  CalendarTool.h
//  Daybook
//
//  Created by dllo on 16/5/21.
//  Copyright © 2016年 zhangbin. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CalendarTool : NSObject


// NSDate @"yyyy-MM-dd"

+ (CalendarTool *)shareCalendarTool;

/*********************       扩展方法   *********************************/
// 根据date将该日期划分为周
//  eg:  ["06.01-06.04", "06.05-06.11" ...]
- (NSMutableArray *)arrayMonthWeekendFromDate:(NSDate *)date;

// 返回周几
- (NSString *)weekStringFromDate:(NSDate *)date;



/*********************     其它date方法   *******************************/
//返回截止到该日期时有几天
- (NSInteger)day:(NSDate *)date;
//第几月
- (NSInteger)month:(NSDate *)date;
//年份
- (NSInteger)year:(NSDate *)date;
//这个月的第一天是周几
- (NSInteger)firstWeekdayInThisMonth:(NSDate *)date;
//这个月有几天
- (NSInteger)totaldaysInMonth:(NSDate *)date;
//上个月的的时间
- (NSDate *)lastMonth:(NSDate *)date;
//下一个月的时间
- (NSDate*)nextMonth:(NSDate *)date;
//通过数字返回周几
- (NSString *)getWeekStringFromInteger:(NSInteger)week;
//通过date返回周几的下标
- (NSInteger)getIndexFromDate:(NSDate *)date;
// 这个月第一天
- (NSDate *)firstDayFromDate:(NSDate *)date; // yyyy-MM-dd HH:mm:ss
// 这个月最后一天
- (NSDate *)lastDayFromDate:(NSDate *)date;  // yyyy-MM-dd HH:mm:ss


/********************     date与string转换   ****************************/
//NSString转NSDate
- (NSDate *)dateFromString:(NSString *)dateString;

//NSDate转NSString
- (NSString *)stringFromDate:(NSDate *)date;

// 返回具体的时间  eg:2016.05.17 15:48

- (NSString *)detailStringFromDate:(NSDate *)date;

/***********************************************************************/

- (NSDate *)beginDateFromSmallStringDate:(NSDate *)date;

- (NSDate *)endDateFromSmallStringDate:(NSDate *)date;

- (NSMutableArray *)AccountBookModelArrayFromSmallDate:(NSDate *)date;


- (NSString *)getMonthAndDayStringFromDate:(NSDate *)date;

@end
